﻿using mozhi.smarterp.Business.Enums;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace mozhi.smarterp.Business.Sales.Quotations
{
    public class SaleQuotationCreateDto
    {
        [Required]
        public SaleQuotationType Type { get; set; }

        [Required] 
        public DateTime Date { get; set; }

        [Required]
        public Guid CustomerId { get; set; }

        public string Address { get; set; }

        public Guid? DepartmentId { get; set; }

        public Guid? SalePersonId { get; set; }

        [Required]
        public Guid CurrencyId { get; set; }

        [Required]
        public decimal ExchangeRate {  get; set; }

        /// <summary>
        /// 生效日期
        /// </summary>
        public DateTime? EffectiveDate { get; private set; }

        /// <summary>
        /// 失效日期
        /// </summary>
        public DateTime? ExpirationDate { get; private set; }

        public bool IncludeTax {  get; set; }

        public string Comment {  get; set; }

        public List<SaleQuotationCreateItemDto> Items { get; set; }
    }

    public class SaleQuotationCreateItemDto
    {
        [Required]
        public Guid ProductId { get; set; }

        [Required]
        public Guid SaleUnitId { get; set; }

        [Required]
        public decimal SaleQuantity { get; set; }

        [Required]
        public decimal Price { get; set; }

        public Guid? TaxRateId { get; set; }

        public bool IsGift {  get; set; }

        public string Remark {  get; set; }
    }
}
